﻿using System.Collections;
using Gp.Scripts.Data.Skills;
using Gp.Scripts.Core;

namespace Gp.AI {
    public enum WeaponSelect {
        RangedFirst,
        MeleeFirst,
        Wise,
    }


    [CreateNodeMenu("一般行为/激活武器")]
    public class ActivateWeaponAINode : NormalAINode {
        // public bool WeaponSelect
        public override AINodeEntry NodeEntry() {
            return new ActivateWeaponAINodeEntry(this);
        }
    }


    public class ActivateWeaponAINodeEntry : NormalAINodeEntry<ActivateWeaponAINode> {
        public ActivateWeaponAINodeEntry(ActivateWeaponAINode data) : base(data) { }

        // private ActivateWeaponAbilityEntity _skill;

        protected override void PreCalculate() {
            // _skill = Unit.ComSkill.GetWeaponSkillEntity<ActivateWeaponAbilityEntity>(Unit.ComEquip.CurWeapon);
        }


        // public override bool ShouldPerform() {
        //     // 判断单位当前武器
        //     return _skill != null && _skill.CanPerform().Result();
        // }
        //
        //
        // public override IEnumerator OnExecute() {
        //     yield return _skill.AIExecute(SkillContext.Empty);
        // }
        //
        //
        // protected override AIActionArgs GetActionInfo() {
        //     var args = AIActionArgs.Build(_skill);
        //     args.Description = "激活武器：" + _skill.Weapon.Equip.ItemName;
        //     return args;
        // }
    }
}